<<<<<<< HEAD
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Hlb extends CI_Controller {
	
	private $tab ='borrow';
	
	function __construct(){
		parent::__construct();
		/** 登陆验证 */
		if(!isset($_SESSION)){
		    session_start();
		}
		$admin = $this->session->userdata('admin_user');
		if(!$admin || !isset($admin['user_id'])){
			header('Location: /sys_admin/login');
			exit;
		}
	}
	
	
	function guardlist(){
		$data['username'] = trim($this->input->get('username'));
		$data['per_page'] = intval($this->input->get('per_page'));
		$data['page_size'] = sys_admin_LIST_PAGE_SIZE;
		$this->load->model('Guard_model');
		
		$data['ftype'] = intval($this->input->get('ftype'));
		
		
		$data['fstatus'] = trim($this->input->get('fstatus'));
		if($data['fstatus'] == 'pending'){
			$data['fstatus'] = 0;
		}elseif($data['ftype']){
			$data['fstatus'] = 1;
		}
		$vdata = $this->Guard_model->get_guard_into_list($data);
		
		//分页
		$this->load->library('pagination');
		$config['base_url'] = '/sys_admin/hlb/guardlist/?username='.$username.'&fstatus='.$fstatus;
		$config['total_rows'] = $vdata['count'];
		$config['per_page'] = sys_admin_LIST_PAGE_SIZE; 
		$this->pagination->initialize($config); 
		
		$vdata['tab'] = $this->tab;
		
		if($data['fstatus'] == 'pending'){
			$sub = 'hlb_first';
		}if($data['ftype'] == 1){
			$sub = 'hlb_guard_into';
		}else if($data['ftype'] == 2){
			$sub = 'hlb_guard_out';
		}
		
		$vdata['sub'] = $sub;
		$vdata['where'] =$data;
		$this->load->view('/sys_admin/borrow/hlb_list', $vdata);
		
	}
	
	function verify(){
		$id = intval($id);
		$this->load->model('Guard_model');
		
		//接收参数
		
		$fstatus = $_POST['fstatus'];
		$ftype = $_POST['ftype'];
		
		$data = array('fstatus'=>$fstatus);
		
		$user = $this->session->userdata('rsh_user');
		$data['id'] 		= intval($_POST['id']);
		$data['addip'] = $this->js->get_ip();
		
		if($ftype == 1){
			$res = $this->Guard_model->guard_verify_into($data);
		}elseif($ftype == 2){
			$res = $this->Guard_model->guard_verify_out($data);
		}		
		
		if($res==1){
			$this->load->model('log_model');$this->log_model->add_log('[审核][活利宝]');
			echo '操作成功';
		}else{
			echo '操作失败';
		}
		
	}
	
	function guardloglist(){
		
		$data['username'] = trim($this->input->get('username'));
		$data['per_page'] = intval($this->input->get('per_page'));
		$data['page_size'] = sys_admin_LIST_PAGE_SIZE;
		$this->load->model('Guard_model');
		
		$vdata = $this->Guard_model->get_guard_log_list($data);
		
		//分页
		$this->load->library('pagination');
		$config['base_url'] = '/sys_admin/hlb/guardloglist/?username='.$username;
		$config['total_rows'] = $vdata['count'];
		$config['per_page'] = sys_admin_LIST_PAGE_SIZE; 
		$this->pagination->initialize($config); 
		
		$vdata['tab'] = $this->tab;
		$vdata['where'] =$data;
		$vdata['sub'] = 'hlb_guard_log';
		$this->load->view('/sys_admin/borrow/hlb_log_list', $vdata);
	}
	
=======
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Hlb extends CI_Controller {
    
	private $tab ='borrow';
	
	function __construct(){
		parent::__construct();
		/** 登陆验证 */
		if(!isset($_SESSION)){
		    session_start();
		}
		$admin = $this->session->userdata('admin_user');
		if(!$admin || !isset($admin['user_id'])){
			header('Location: /sys_admin/login');
			exit;
		}
	}
	
	
	function guardlist(){
		$data['username'] = trim($this->input->get('username'));
		$data['per_page'] = intval($this->input->get('per_page'));
		$data['page_size'] = sys_admin_LIST_PAGE_SIZE;
		$this->load->model('Guard_model');
		
		$data['ftype'] = intval($this->input->get('ftype'));
		
		
		$data['fstatus'] = trim($this->input->get('fstatus'));
		if($data['fstatus'] == 'pending'){
			$data['fstatus'] = 0;
		}elseif($data['ftype']){
			$data['fstatus'] = 1;
		}
		$vdata = $this->Guard_model->get_guard_into_list($data);
		
		//分页
		$this->load->library('pagination');
		$config['base_url'] = '/sys_admin/hlb/guardlist/?username='.$username.'&fstatus='.$fstatus;
		$config['total_rows'] = $vdata['count'];
		$config['per_page'] = sys_admin_LIST_PAGE_SIZE; 
		$this->pagination->initialize($config); 
		
		$vdata['tab'] = $this->tab;
		
		if($data['fstatus'] == 'pending'){
			$sub = 'hlb_first';
		}if($data['ftype'] == 1){
			$sub = 'hlb_guard_into';
		}else if($data['ftype'] == 2){
			$sub = 'hlb_guard_out';
		}
		
		$vdata['sub'] = $sub;
		$vdata['where'] =$data;
		$this->load->view('/sys_admin/borrow/hlb_list', $vdata);
		
	}
	
	function verify(){
		$id = intval($id);
		$this->load->model('Guard_model');
		
		//接收参数
		
		$fstatus = $_POST['fstatus'];
		$ftype = $_POST['ftype'];
		
		$data = array('fstatus'=>$fstatus);
		
		$user = $this->session->userdata('rsh_user');
		$data['id'] 		= intval($_POST['id']);
		$data['addip'] = $this->js->get_ip();
		
		if($ftype == 1){
			$res = $this->Guard_model->guard_verify_into($data);
		}elseif($ftype == 2){
			$res = $this->Guard_model->guard_verify_out($data);
		}		
		
		if($res==1){
			$this->load->model('log_model');$this->log_model->add_log('[审核][活利宝]');
			echo '操作成功';
		}else{
			echo '操作失败';
		}
		
	}
	
	function guardloglist(){
		
		$data['username'] = trim($this->input->get('username'));
		$data['per_page'] = intval($this->input->get('per_page'));
		$data['page_size'] = sys_admin_LIST_PAGE_SIZE;
		$this->load->model('Guard_model');
		
		$vdata = $this->Guard_model->get_guard_log_list($data);
		
		//分页
		$this->load->library('pagination');
		$config['base_url'] = '/sys_admin/hlb/guardloglist/?username='.$username;
		$config['total_rows'] = $vdata['count'];
		$config['per_page'] = sys_admin_LIST_PAGE_SIZE; 
		$this->pagination->initialize($config); 
		
		$vdata['tab'] = $this->tab;
		$vdata['where'] =$data;
		$vdata['sub'] = 'hlb_guard_log';
		$this->load->view('/sys_admin/borrow/hlb_log_list', $vdata);
	}
	
>>>>>>> d47623b610d79a4eeb489500830c00d70933f414
}